import request from '@/utils/request'

// 自定义事件消息数量统计图表
export function channelSelectListVO(data) {
	let url = '';
	let baseUrl = `${process.env.VUE_APP_BASE_API}/gmEventData/selectNewUserCountByDate?startDate=${data.startDate}&endDate=${data.endDate}&appKey=${data.appKey}&eventId=${data.eventId}`;
	url = baseUrl + (data.channel ? ('&channel=' + data.channel) : ('')) + (data.version ? ('&appVersion=' + data.version) : (''))
	return request({
		url,
		method: 'get',
		headers: {
			'Content-Type': 'x-www-form-urlencoded'
		}
	})
}

// 事件参数列表
export function getEventDetailList(data) {
	let url = '';
	let baseUrl = `${process.env.VUE_APP_BASE_API}/gmEventData/eventDetailList?current=${data.current}&size=${data.size}&startTime=${data.startDate}&endTime=${data.endDate}&appKey=${data.appKey}`;
	url = baseUrl + (data.version ? ('&appVersion=' + data.version) : ('')) + (data.eventId ? ('&eventId=' + data.eventId) : (''))
	return request({
    url,
    method: 'get',
    headers: {
      'Content-Type': 'x-www-form-urlencoded'
    }
  })
}
